package tsinghua.smxq.foodprice;


public class FoodandFoodId
{
	public static int getFoodId(String foodname)
	{
		int result = -1;
		if(foodname.compareToIgnoreCase("牛")==0)
		{
			result = 0;
		}
		else if(foodname.compareToIgnoreCase("羊")==0)
		{
			result = 1;
		}
		else if(foodname.compareToIgnoreCase("鸡")==0)
		{
			result = 2;
		}
		else if(foodname.compareToIgnoreCase("猪")==0)
		{
			result = 3;
		}
		else if(foodname.compareToIgnoreCase("鸭")==0)
		{
			result = 4;
		}
		else if(foodname.compareToIgnoreCase("鳝鱼")==0)
		{
			result = 5;
		}
		else if(foodname.compareToIgnoreCase("茄子")==0)
		{
			result = 6;
		}
		else if(foodname.compareToIgnoreCase("山药")==0)
		{
			result = 7;
		}
		else if(foodname.compareToIgnoreCase("空心菜")==0)
		{
			result = 8;
		}
		else if(foodname.compareToIgnoreCase("豆芽")==0)
		{
			result = 9;
		}
		else if(foodname.compareToIgnoreCase("土豆")==0)
		{
			result = 10;
		}
		else if(foodname.compareToIgnoreCase("海带")==0)
		{
			result = 11;
		}  
		else if(foodname.compareToIgnoreCase("木耳")==0)
		{
			result = 12;
		}    
		else if(foodname.compareToIgnoreCase("油麦菜")==0)
		{
			result = 13;
		}    
		else if(foodname.compareToIgnoreCase("烤鸭")==0)
		{
			result = 14;
		}  
		else if(foodname.compareToIgnoreCase("百味鸡")==0)
		{
			result = 15;
		}  
		else if(foodname.compareToIgnoreCase("卤菜")==0)
		{
			result = 16;
		}  
		else if(foodname.compareToIgnoreCase("猪蹄")==0)
		{
			result = 17;
		}  
		else if(foodname.compareToIgnoreCase("鸭脖")==0)
		{
			result = 18;
		}	
		return result;
	}
	
	public static String getFood(int foodId)
	{
		String food = "";
		switch(foodId)
		{
		case 0:
			food = "牛";
			break;
		case 1:
			food = "羊";
			break;
		case 2:
			food = "鸡";
			break;
		case 3:
			food = "猪";
			break;
		case 4:
			food = "鸭";
			break;
		case 5:
			food = "鳝鱼";
			break;
		case 6:
			food = "茄子";
			break;
		case 7:
			food = "山药";
			break;
		case 8:
			food = "空心菜";
			break;
		case 9:
			food = "豆芽";
			break;
		case 10:
			food = "土豆";
			break;
		case 11:
			food = "海带";
			break;
		case 12:
			food = "木耳";
			break;
		case 13:
			food = "油麦菜";
			break;
		case 14:
			food = "烤鸭";
			break;
		case 15:
			food = "百味鸡";
			break;	
		case 16:
			food = "卤菜";
			break;	
		case 17:
			food = "猪蹄";
			break;	
		case 18:
			food = "鸭脖";
			break;				
		}
		return food;
	}
	
}
